<%--
  User: Shengzhao Li
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>账务类型</title>
</head>
<body>
<%--account type form page--%>
<div id="account_type_form_page" data-role="page" data-title="账务类型表单" class="page">
    <div data-role="header" data-theme="f">
        <a href="${contextPath}/m/dashboard" data-icon="home" data-direction="reverse" data-transition="slide">主页</a>

        <h1>账务类型</h1>
        <a href="overview" data-icon="arrow-l" data-transition="slide" data-direction="reverse">返回</a>
    </div>
    <div data-role="content">
        <form:form commandName="accountType" id="account_type_form">
            <ul data-role="listview">
                <li>
                    <div data-role="fieldcontain">
                        <label for="name_">名称:</label>
                        <form:input path="name" id="name_"/>
                        <span class="red">*</span>
                        <form:errors path="name" cssClass="form_error"/>
                    </div>
                    <div data-role="fieldcontain">
                        <label for="description_">描述:</label>
                        <form:input path="description" id="description_"/>
                    </div>
                    <div data-role="fieldcontain">
                        <fieldset data-role="controlgroup">
                            <legend>样式:</legend>
                            <c:forEach items="${accountType.availableStyles}" var="sty">
                                <form:radiobutton path="style" value="${sty}" label="${sty.label}"
                                                  data-theme="${sty.label}"/>
                            </c:forEach>
                        </fieldset>
                    </div>
                    <div data-role="fieldcontain">
                        <label for="used_times_">使用次数:</label>
                        <form:input path="usedTimes" id="used_times_" readonly="true" cssClass="color-b"
                                    data-mini="true"/>
                    </div>
                    <div data-role="fieldcontain">
                        <label for="daily_">日常账务类型</label>
                        <select name="daily" data-role="slider" id="daily_" ${accountType.defaultType?'disabled':''}>
                            <option value="false" ${accountType.daily?'':'selected'}>否</option>
                            <option value="true" ${accountType.daily?'selected':''}>是</option>
                        </select>
                    </div>
                    <div data-role="fieldcontain">
                        <label for="publicity_">是否公开 </label>
                        <select name="publicity" data-role="slider"
                                id="publicity_" ${accountType.defaultType?'disabled':''}>
                            <option value="false" ${accountType.publicity?'':'selected'}>否</option>
                            <option value="true" ${accountType.publicity?'selected':''}>是</option>
                        </select>
                    </div>
                </li>
                <li>
                    <div data-role="fieldcontain">
                        <c:if test="${!accountType.defaultType}">
                            <button type="submit" data-theme="b" data-icon="plus">保存</button>
                            <c:if test="${accountType.editable}">
                                <a href="confirm_delete/${accountType.guid}" data-theme="b" data-icon="delete"
                                   data-role="button">删除</a>
                            </c:if>
                        </c:if>
                        <a href="javascript:void(0);" data-theme="c" data-icon="arrow-l" data-role="button"
                           data-rel="back">返回</a>
                    </div>
                </li>
            </ul>
        </form:form>
    </div>
</div>
</body>
</html>